let con = document.querySelector(".container");
let nums = ["One", "Two", "Three"];
let colors = ["red", "green", "blue"];
con.addEventListener("click", () => {
  let items = document.querySelectorAll(".item");
  items.forEach((item) => {
    let h = parseInt(item.style.bottom, 10) + 75;
    console.log(h);
    item.style.bottom = h + "px";
  });
  let idx = Math.floor(Math.random() * 3);
  let newDiv = document.createElement("div");
  newDiv.className = "item";
  newDiv.textContent = "Message " + nums[idx];
  newDiv.style.color = colors[idx];
  newDiv.style.bottom = 0;
  document.body.appendChild(newDiv);
  setTimeout(() => {
    document.body.removeChild(newDiv);
  }, 2000);
});
